package model

import (
	model "beesoft.ink/application/text/app/model/base"
	"time"
)

type LanguageModel struct {
	model.Model
	Type               uint    `json:"type"`
	Category           uint    `json:"category"`
	Provider           string  `json:"provider"`
	Supplier           string  `json:"supplier"`
	Name               string  `json:"name"`
	Title              string  `json:"title"`
	Remark             string  `json:"remark"`
	Document           string  `json:"document"`
	ContextWindow      int64   `json:"context_window"`
	ContextLengthRange string  `json:"context_length_range"`
	InputMaxTokens     int64   `json:"input_max_tokens"`
	InputPriceUnit     string  `json:"input_price_unit"`
	InputPriceAmount   float64 `json:"input_price_amount"`
	OutputMaxTokens    int64   `json:"output_max_tokens"`
	OutputPriceUnit    string  `json:"output_price_unit"`
	OutputPriceAmount  float64 `json:"output_price_amount"`
	Language           string  `json:"language"`
}

func (LanguageModel) TableName() string {
	return "beesoft_models"
}

type ProviderAlibaba struct {
	InferenceOutputTokenPriceUnit     string   `json:"inferenceOutputTokenPriceUnit,omitempty"`
	GmtModified                       int64    `json:"gmtModified"`
	ModelConfig                       string   `json:"modelConfig,omitempty"`
	GmtCreated                        int64    `json:"gmtCreated"`
	ModelId                           string   `json:"modelId"`
	OpenSource                        bool     `json:"openSource"`
	TagIds                            []string `json:"tagIds"`
	Description                       string   `json:"description"`
	PostDeployPriceDigits             string   `json:"postDeployPriceDigits,omitempty"`
	Offline                           bool     `json:"offline"`
	SupportInference                  bool     `json:"supportInference"`
	ApplicationProductIdForPlainModel int      `json:"applicationProductIdForPlainModel,omitempty"`
	ProviderId                        string   `json:"providerId"`
	Scope                             string   `json:"scope"`
	PostDeployPriceUnit               string   `json:"postDeployPriceUnit,omitempty"`
	SupportDeploy                     bool     `json:"supportDeploy"`
	SetId                             string   `json:"setId"`
	OnlineTime                        int64    `json:"onlineTime"`
	SupportSft                        bool     `json:"supportSft"`
	Id                                int      `json:"id"`
	QpmInfo                           struct {
		ModelDefaultActual struct {
			CountLimitPeriod int    `json:"count_limit_period"`
			UsageLimit       int    `json:"usage_limit"`
			UsageLimitField  string `json:"usage_limit_field"`
			CountLimit       int    `json:"count_limit"`
			UsageLimitPeriod int    `json:"usage_limit_period"`
			Type             string `json:"type"`
		} `json:"data-default-actual"`
		ModelDefault struct {
			CountLimitPeriod int    `json:"count_limit_period"`
			UsageLimit       int    `json:"usage_limit"`
			UsageLimitField  string `json:"usage_limit_field"`
			CountLimit       int    `json:"count_limit"`
			UsageLimitPeriod int    `json:"usage_limit_period"`
			Type             string `json:"type"`
		} `json:"data-default"`
	} `json:"qpmInfo,omitempty"`
	SupportExperience               bool     `json:"supportExperience"`
	FtPermission                    bool     `json:"ftPermission"`
	InferenceOutputTokenPriceDigits string   `json:"inferenceOutputTokenPriceDigits,omitempty"`
	ModelExt                        string   `json:"modelExt,omitempty"`
	SupportSellingByQpm             bool     `json:"supportSellingByQpm"`
	DeployPermission                bool     `json:"deployPermission"`
	SupportDisplayQpmLimit          bool     `json:"supportDisplayQpmLimit"`
	SupportEval                     bool     `json:"supportEval"`
	SupportFt                       bool     `json:"supportFt"`
	MaxOutputTokens                 int      `json:"maxOutputTokens,omitempty"`
	InferenceInputTokenPriceDigits  string   `json:"inferenceInputTokenPriceDigits,omitempty"`
	SupportCpt                      bool     `json:"supportCpt"`
	SupportTokenizer                bool     `json:"supportTokenizer"`
	ContextWindow                   int      `json:"contextWindow,omitempty"`
	MaxInputTokens                  int      `json:"maxInputTokens,omitempty"`
	ModelOrder                      int      `json:"modelOrder"`
	SellStatus                      int      `json:"sellStatus"`
	TypeIds                         []string `json:"typeIds"`
	Name                            string   `json:"name"`
	DocUrl                          string   `json:"docUrl"`
	NeedApply                       bool     `json:"needApply"`
	SupportApp                      bool     `json:"supportApp"`
	SupportDpo                      bool     `json:"supportDpo"`
	IfPermission                    bool     `json:"ifPermission"`
	InferenceInputTokenPriceUnit    string   `json:"inferenceInputTokenPriceUnit,omitempty"`
	ModelIdAlias                    string   `json:"modelIdAlias,omitempty"`
	TrainPriceUnit                  string   `json:"trainPriceUnit,omitempty"`
	TrainPriceDigits                string   `json:"trainPriceDigits,omitempty"`
	ApplyStatus                     int      `json:"applyStatus,omitempty"`
}
type ProviderBaidu struct {
	ModelIdStr          string    `json:"modelIdStr"`
	ModelName           string    `json:"modelName"`
	ModelType           int       `json:"modelType"`
	Description         string    `json:"description"`
	VersionCount        int       `json:"versionCount"`
	ModifyTime          time.Time `json:"modifyTime"`
	IsStarModel         bool      `json:"isStarModel"`
	IsNewest            bool      `json:"isNewest"`
	IsFree              bool      `json:"isFree"`
	ContextLengthRanges []string  `json:"contextLengthRanges"`
	LanguageSupport     []string  `json:"languageSupport"`
	Expansion           []string  `json:"expansion"`
	Vendors             []string  `json:"vendors"`
	VersionSummaries    []struct {
		VersionIdStr   string   `json:"versionIdStr"`
		Version        string   `json:"version"`
		ApiDocLink     string   `json:"apiDocLink,omitempty"`
		PresetService  string   `json:"presetService"`
		SupportOptions []string `json:"supportOptions"`
	} `json:"versionSummaries"`
}
type ProviderDoubao struct {
	Name          string `json:"Name"`
	Description   string `json:"Description"`
	Introduction  string `json:"Introduction"`
	VendorName    string `json:"VendorName"`
	DisplayName   string `json:"DisplayName"`
	ShortName     string `json:"ShortName"`
	FeaturedImage struct {
		BucketName string `json:"BucketName"`
		ObjectKey  string `json:"ObjectKey"`
	} `json:"FeaturedImage"`
	PrimaryVersion     string `json:"PrimaryVersion"`
	FoundationModelTag struct {
		Domains        []string `json:"Domains"`
		Languages      []string `json:"Languages,omitempty"`
		TaskTypes      []string `json:"TaskTypes,omitempty"`
		ContextLength  string   `json:"ContextLength,omitempty"`
		CustomizedTags []string `json:"CustomizedTags,omitempty"`
		UsedLibraries  []string `json:"UsedLibraries,omitempty"`
	} `json:"FoundationModelTag"`
	AccessType     string    `json:"AccessType"`
	ProjectName    string    `json:"ProjectName"`
	ResourceOrigin string    `json:"ResourceOrigin"`
	CreateTime     time.Time `json:"CreateTime"`
	UpdateTime     time.Time `json:"UpdateTime"`
}
type ProviderZhipu struct {
	ModelCenterId         string   `json:"modelCenterId"`
	ModelName             string   `json:"modelName"`
	ModelCode             string   `json:"modelCode"`
	ModelType             string   `json:"modelType"`
	ModelCategory         string   `json:"modelCategory"`
	ModelCategoryName     string   `json:"modelCategoryName"`
	LinkType              []string `json:"linkType"`
	Sort                  int      `json:"sort"`
	Description           string   `json:"description"`
	EnDescription         string   `json:"enDescription"`
	ModelTag              string   `json:"modelTag"`
	OwnerId               string   `json:"ownerId"`
	FineTuningMethod      []string `json:"fineTuningMethod"`
	DocumentPath          string   `json:"documentPath,omitempty"`
	OperatePath           string   `json:"operatePath,omitempty"`
	HotFlag               int      `json:"hotFlag"`
	HotDescription        string   `json:"hotDescription"`
	DeployFlag            bool     `json:"deployFlag"`
	ExperienceVisibleFlag bool     `json:"experienceVisibleFlag"`
	PrivateDeployFlag     bool     `json:"privateDeployFlag"`
	ModelCodeViewFlag     bool     `json:"modelCodeViewFlag"`
}
